# Replication Package: The Safe Asset Cliff — Demographic Downgrade Risk and Collateral Scarcity

## Overview
This folder contains all files needed to replicate the analysis in "The Safe Asset Cliff." The paper shows a demographic tipping point at 20% OADR for sovereign creditworthiness: below it, aging supports ratings (income/institutions channel); above it, each additional percentage point reduces ratings by 8.6 notches on the S&P scale (spline β = -17.5***). Monte Carlo projections show safe issuers falling from 24 to ~14 by mid-century.

## Requirements
- Python 3.10+
- pandas, numpy, scipy, statsmodels
- Data files in data/processed/

## Structure
- `scripts/` — Analysis scripts (run in phase order)
- `src/` — Shared modules (PanelGLS estimator, data loading, country classifications)
- `data/processed/` — Processed panel data (cliff_panel.csv)
- `output/tables/` — Generated output tables
- `output/figures/` — Generated figures
- `paper/` — Paper manuscript

## Reproduction
Run scripts in numerical phase order:
```
python scripts/phase1_data_assembly.py
python scripts/phase2_descriptive.py
python scripts/phase3_downgrade_prediction.py
python scripts/phase4_continuous_rating.py
python scripts/phase5_interactions.py
python scripts/phase6_stress_test.py
python scripts/phase7_robustness.py
python scripts/phase8_oos_backtest.py
python scripts/phase9_reserve_composition.py
```

## Data Sources
- UN World Population Prospects 2024
- IMF World Economic Outlook
- S&P Sovereign Credit Ratings (historical)
- Penn World Table 10.01
- Lane & Milesi-Ferretti External Wealth of Nations
- Chinn-Ito KAOPEN Index

## Notes
- All analysis uses the 140-country expanded panel
- The `src/` modules are shared with the multilateral project and contain the expanded country lists
- OADR spline at 20%: base = +8.86** (institutions/demand), spline = -17.49*** (fiscal deterioration dominates above threshold)
- Monte Carlo (1,000 draws): median safe issuers 24→13.5 by 2054; safe supply ratio 0.89→0.77
- Most vulnerable: Finland, France, Hong Kong, Czech Republic, Taiwan
